package com.genesis.web.controller;

import com.genesis.mall.common.Result;
import com.genesis.mall.entity.CmsPrefrenceArea;
import com.genesis.mall.service.ICmsPrefrenceAreaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 优选专区 前端控制器
 * </p>
 *
 * @author author
 * @since 2022-08-01
 */
@RestController
//@RequestMapping("/cms-prefrence-area")
@RequestMapping("/prefrenceArea")
@Slf4j
public class CmsPrefrenceAreaController {

    @Autowired
    private ICmsPrefrenceAreaService cmsPrefrenceAreaService;

    /**
     * 查询优选专区
     * @return
     */
    @GetMapping("listAll")
    public Result<List<CmsPrefrenceArea>> listAll(){
        log.info("查询优选专区");
        List<CmsPrefrenceArea> list = cmsPrefrenceAreaService.list();

        return Result.success(list);
    }

}